<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<button onclick="axiosFn()">axios</button>
<button onclick="ajaxFn()">ajax</button>
<button onclick="axiosPost()">axios-post</button>
<button onclick="ajaxPost()">ajax-post</button>

<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>

<script>
    var axiosFn = function (params) {
        axios({
            method: 'get',
            url: 'http://127.0.0.1:8888/get?name=axios',
        }).then(function (response) {
            console.log(response);
        }).catch(function (err) {mh
            console.log(err);
        });
    }

    var ajaxFn = function () {
        $.ajax({
            method: 'get',
            url: 'http://127.0.0.1:8888/get?name=ajax',
            success: function (data) {
                console.log(data);
            },
            erroe: function (data) {
                console.log(data);
            }
        })
    }

    var axiosPost = function () {
        axios({
            method: 'post',
            url: 'http://127.0.0.1:8889',
            data: {
                name: "axios postMsg"
            }
        }).then(function (response) {
            console.log(response);
        }).catch(function (err) {
            console.log(err);
        });
    }

    var ajaxPost = function () {
        $.ajax({
            method: 'post',
            url: 'http://127.0.0.1:8889',
            data: {
                name: "ajax postMsg"
            },
            success: function (data) {
                console.log(data);
            },
            erroe: function (data) {
                console.log(data);
            }
        })
    }
</script>
</body>


</html>